﻿namespace Viyi.Util.NameStyle
{
    internal sealed class PascalStyleConverter : IStyleConverter
    {
        public string Convert(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return name;
            }

            return Contants.SplitedRegex.Replace(
                Contants.LowerRegex.IsMatch(name) ? name : name.ToLower(),
                m => m.Groups[1].Value.ToUpper()
            );
        }
    }
}
